const wallpapers = require("express").Router();
const { Validator, wallpaper } = require("../../../validators");
const WallpaperController = require("../../../controllers/wallpaper");
// 壁纸列表
wallpapers.get("/", WallpaperController.list);
// 新增壁纸
wallpapers.post("/", Validator(wallpaper.add), WallpaperController.add);
// 获取壁纸详情
wallpapers.get("/:id", Validator(wallpaper.detail), WallpaperController.detail);
// 修改壁纸
wallpapers.patch(
    "/:id",
    Validator(wallpaper.update),
    WallpaperController.update
);
// 删除壁纸
wallpapers.delete(
    "/:id",
    Validator(wallpaper.delete),
    WallpaperController.delete
);
// 获取壁纸的下载人员列表
wallpapers.get(
    "/:id/downloads",
    Validator(wallpaper.downloads),
    WallpaperController.downloads
);
// 获取壁纸的评分人员列表
wallpapers.get(
    "/:id/ratings",
    Validator(wallpaper.ratings),
    WallpaperController.ratings
);

module.exports = wallpapers;
